<?php
$subject = '<p><img src="images/stories/otakuzoku1.jpg" border="0" alt="Inside Otakuzoku\'s store" /><img src="images/user_files/flash_area_distant.jpg" border="0" /><img src="images/user_files/flash_area_lounge.jpg" border="0" /><img src="images/user_files/flash_area_runway.jpg" border="0" /></p>"';

// $pattern = "/([\w-:\*]*)(?:\#([\w-]+)|\.([\w-]+))?(?:\[@?(!?[\w-:]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is";
// preg_match_all($pattern, 'img'.' ', $matches, PREG_SET_ORDER);
// $pattern = '/< *img[^>]*src *= *["\']?([^"\']*)/i';
// preg_match($pattern, $subject, $matches);
// print_r($matches);


// Create DOM from URL or file
$html = str_get_html($subject);

// Find all images
foreach($html->find('img') as $element)
       print_r($element->src);

// Find all links
// foreach($html->find('a') as $element)
       // echo $element->href . '<br>'; 
?>
